package com.osfw.activiti.domain;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Map;

/**
 * 流程审批信息
 */
@Data
@Accessors(chain = true)
public class ProcessApproval implements Serializable {
    private static final long serialVersionUID = 1L;

    /* 流程任务ID */
    private Long procTaskId;

    /* 流程定义ID */
    private Long procDefId;

    /* 流程实例ID */
    private Long procInstId;

    /* 流程执行ID */
    private Long procExecId;

    /* 流程活动的KEY */
    private String actKey;

    /* 流程活动的名称 */
    private String actName;

    /* 处理结果（1-同意，2-不同意，3-退回） */
    private Integer result;

    /* 退回得流程活动的KEY */
    private String returnActKey;

    /* 退回得流程活动的名称 */
    private String returnActName;

    /* 处理意见 */
    private String comment;

    /* 签收人（被委托人）签字 */
    private String signature;

    /* 签收人（被委托人）印章 */
    private String stamp;

    /* 流程全局变量 */
    private Map<String, Object> globalVariables;

    /* 流程局部变量 */
    private Map<String, Object> localVariables;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("procTaskId", getProcTaskId())
                .append("procDefId", getProcDefId())
                .append("procInstId", getProcInstId())
                .append("procExecId", getProcExecId())
                .append("result", getResult())
                .append("returnActKey", getReturnActKey())
                .append("returnActName", getReturnActName())
                .append("comment", getComment())
                .append("signature", getSignature())
                .append("stamp", getStamp())
                .append("globalVariables", JSONObject.toJSONString(getGlobalVariables()))
                .append("localVariables", JSONObject.toJSONString(getLocalVariables()))
                .toString();
    }

}
